$("#wrapper").css({"width":$("#wrapper .slide").length * 70 + 10+"%"})
var index = 1;
var offsetx = $("#wrapper .slide")[1].offsetWidth/$("#wrapper")[0].offsetWidth * 100;
var offsetl = -offsetx;
$("#wrapper").css({"transform":"translateX("+offsetl+"%)","transition":"all 0s"})
$(".slide").eq(index).attr("class","slide active").siblings().attr("class","slide");
$("#wrapper").bind("swipeLeft",function(){
  if(offsetl <= -offsetx * ($("#wrapper .slide").length - 2)){
    offsetl = -offsetx;
    index = 1;
    $("#wrapper").css({"transform":"translateX("+offsetl+"%)","transition":"all 0s"})
    $(".slide").eq(index).attr("class","slide active").siblings().attr("class","slide");
  }else{
    offsetl -= offsetx;
    index++;
    $("#wrapper").css({"transform":"translateX("+offsetl+"%)","transition":"all 0.25s"})
    $(".slide").eq(index).attr("class","slide active").siblings().attr("class","slide");
  }

})
$("#wrapper").swipeRight(function(){
  if(offsetl >= -offsetx){
    offsetl = -offsetx * ($("#wrapper .slide").length - 2);
    index = $("#wrapper .slide").length - 2;
    $("#wrapper").css({"transform":"translateX("+offsetl+"%)","transition":"all 0s"})
    $(".slide").eq(index).attr("class","slide active").siblings().attr("class","slide");
  }else{
    index--;
    offsetl += offsetx;
    $("#wrapper").css({"transform":"translateX("+offsetl+"%)","transition":"all 0.25s"})
    $(".slide").eq(index).attr("class","slide active").siblings().attr("class","slide");
  }

})
